//AdminServiceImpl.java
package org.example.demo3.service.impl;

import org.example.demo3.mapper.AdminMapper;
import org.example.demo3.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AdminServiceImpl implements AdminService {
    @Autowired
    AdminMapper adminMapper;

    //登录验证
    @Override
    public boolean login(String username, String password) {
        //如果数据库返回不为空，则为true，否则为false
        return adminMapper.selectByNameAndPwd(username,password) != null;
    }
}
